<?php
class TopController extends AppController {
	var $name = 'Top';

	var $uses = array (
		'JobCountTmp',
		'ViewJobStatusCount',
		'SysParams',
		'Job',
		'Company'
	);
	//	var $access = array (
	//							'index' => array('role' => array('Admin','System','Staff')),
	//						);

	function index() {
		$area_info = $this->SysParams->getArea();
		$tema_info = $this->SysParams->getTema();
		$this->set('attention_img_dir', $this->Prop->getValue('config.job.image.dir'));
		$this->set('area_info', $area_info);
		$this->set('tema_info', $tema_info);
		$this->_setJobData();
		
		$this->render('index');
	}
	function _setJobData() {
		//注目の求人
		$attention_info = $this->Job->getAttentionJob();
		
		//@author wangyuhua 2012/4/24 start
		//attention_basic_flg = 0
		$attention0_info = $this->Job->getAttentionBasic0Job();
		//lfx add 2013-09-27 update attention_url start
		$tmp_data = $attention_info;
		foreach($tmp_data as $k => &  $list){
			$list['Job']['attention_note']=$this->Common->relative_path_set($list['Job']['attention_note']);
			if (!empty($list['Job']['attention_url'])){
				$list['Job']['attention_url'] = 'attention_url/'.$list['Job']['attention_url'];
				$list['Job']['attention_url']=$this->Common->relative_path_set($list['Job']['attention_url']);
			}
		}
		
		$attention_info = $tmp_data;
		unset($tmp_data);
		//lfx add 2013-09-27 update attention_url end
		$this->set('attention0_info', $attention0_info);
		//@author wangyuhua 2012/4/24 end
		
		//新着求人
		//get $pickup_info
		$pickup_info = $this->Job->getPickUpJob();

		//get $sample_info
		$public_info = $this->Job->getPublicJob();		
		
		//2012/11/5 nan 追加
		$this->Output->htmlspecialchars_decode($pickup_info);
		$this->Output->htmlspecialchars_decode($public_info);
		
		$this->set('attention_info', $attention_info);
		$this->set('pickup_info', $pickup_info);
		$this->set('public_info', $public_info);
	}
}
?>